package com.mycompany.ingsoc2;

import java.sql.Connection;
import java.sql.SQLException;

/**
 *
 * @author sebastian
 */
public class FactoryHSQL implements FactoryDAO {
/**
 * 
 * @param strConn
 * @param usr
 * @param pwd
 * @return
 * @throws SQLException 
 */
    @Override
    public Connection createConnection(String strConn,String usr,String pwd) throws SQLException {
        Connection conn;
        ConnectionHSQL mifactory = new ConnectionHSQL();
        conn = mifactory.createConn(strConn,usr, pwd);
        return conn;

    }
/**
 * 
 * @param conn
 * @return
 * @throws SQLException 
 */
    public ModelDB createModelDB(Connection conn) throws SQLException {
        ModelDB mDB;
        mDB = new ModelDBHSQL();
        return mDB;

    }
/**
 * 
 * @param conn
 * @return 
 */
    @Override
    public PeliculaDAO createDAOPelicula(Connection conn)  {
        PeliculaDAO pDAO;
        pDAO = new PeliculaDAOHSQL(conn);
        return pDAO;
    }
/**
 * 
 * @param conn
 * @return
 * @throws SQLException 
 */
    public GeneroDAO createDAOGenero(Connection conn) throws SQLException {
        GeneroDAO gDAO;
        gDAO = new GeneroDAOHSQL(conn);
        return gDAO;
    }

}
